<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:replace="dashboard/header :: header"></head>

<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
			
				<!-- search_start -->
				<div class="ibox-tools" page:hasEdit="search">
				   <a class="dropdown-toggle" data-toggle="dropdown" href="javascript:void(0)" onclick="editoSearch()">
					 <i class="fa fa-wrench"></i>
				   </a> 
				</div>
				<!-- search_end -->
				
				<form id="operlog-form">
					<div class="select-list">
						<ul>
							<li>
								<label>所属应用 </label> 
								<input id="text-input" type="text" onclick="showApplication()" name="applicationIdLabel" readonly="readonly" style="cursor: pointer" placeholder="所属应用">
								<input type="hidden" id="applicationId" name="condition[applicationId]"  />
							</li>
							<li>
								<label>类型名称  </label> 
								<input id="typeName" name="condition[typeName|like]" type="text" placeholder="类型名称">
							</li>
							<li>
								<label>状态  </label> 
								<input id="hasStatus" name="condition[hasStatus|like]" type="text" placeholder="状态">
							</li>
							<li>
								<a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()">
					<i class="fa fa-plus"></i> 新增
				</a>
				<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()">
		            <i class="far fa-trash-alt"></i> 删除
		        </a>
		        <a class="btn btn-danger" onclick="$.operate.clean()">
	                <i class="fa fa-trash"></i> 清空
	            </a>
	            <a class="btn btn-warning" onclick="$.table.exportExcel()">
		            <i class="fa fa-download"></i> 导出
		        </a>
	        </div>
	        
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	
	<footer th:replace="dashboard/footer :: footer"></footer>

	<script>
		var prefix = ctx + "monitor/operlog";

		$(function() {
		    var options = {
		        url: ctx+"boot/platform/contentType/datatables" ,
		        createUrl: ctx + 'boot/platform/contentType/add' ,
		        updateUrl: ctx+"boot/platform/contentType/modify?id={id}" ,
		        statusUrl: ctx+"boot/platform/contentType/changeStatus?id={id}" , 
		        cleanUrl: prefix + "/clean",
		        detailUrl: ctx+"boot/platform/contentType/detail?id={id}",
		        removeUrl: ctx+"boot/platform/contentType/delete" ,
		        exportUrl: prefix + "/export",
		        sortName: "operTime",
		        uniqueId:"id" ,
		        sortOrder: "desc",
		        modalName: "操作日志",
		        escape: true,
		        showPageGo: true,
		        rememberSelected: true,
		        columns: [{field: 'state',checkbox: true },
		        	
		        	 {field: 'applicationIdLabel', title: '应用名称'},
				     {field: 'typeName', title: '类型名称'},
					 {field: 'hasStatusLabel', title: '状态', align: 'center',  formatter:function(value,row,index){ return $.table.status(value , row);}},
				     {field: 'addTime', title: '添加时间'} ,
				     {field: 'id' , title: '操作',  align: 'center',  formatter: function(value, row, index) {
			                var actions = [];
			                
			                actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
			                actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="far fa-trash-alt"></i>删除</a> ');
			                
			                return actions.join('');
			          }
			     }]
		    };
		    $.table.init(options);
		});
		
		function editoSearch(){
			$.modal.alert("正在规划中.") ;
		}	
	</script>
</body>
</html>